#program

class H264Decoder;
class CodecWrapper {
  public:
    enum class Type {
        H263_1996 = 34,
        H263_1998 = 103,
        MPEG4 = 104,
        H264 = 99,
        SORENSON = 100,
        VP6 = 106,
        VP8 = 107,
        VP9 = 112,
        ULPFEC = 108,
        FLEXFEC = 113,
        RED = 109,
        RTX = 110,
        UNKNOWN = -1
    };
    static CodecWrapper *CreateCodecWrapper(Type type);
    static void Release(CodecWrapper **wrapper);

  private:
    CodecWrapper(Type type);
    ~CodecWrapper();

  public:
    bool IsKeyFrame();
    bool DecodePacket(uint8_t *buffer, int size, uint16_t lost, bool mark);
    void SetScale(uint32_t width, uint32_t height);
    int GetWidth();
    int GetHeight();

    uint8_t *GetFrame();
    uint8_t *GetFrameBgr();
    uint8_t *GetFrameYuv();

  public:
    bool outputYuv{false};

  private:
    H264Decoder *impl{nullptr};
}